package server;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;

/**
 * @file Client_Response.java
 * @version 0.1
 * @author James Dibble 10009689
 * 
 * http://code.google.com/p/csp-server/source/browse/
 *                                  trunk/Server/src/server/Client_Response.java
 */
public class Client_Response {
    // <editor-fold defaultstate="collapsed" desc="Attributes">
    BufferedReader brClientInput;
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Constructors">
    /**
     * Create an object to send messages to a client.
     * 
     * @param sSocket   The socket with which the client is connected.
     * @throws IOException 
     */
    public Client_Response(Socket sSocket) throws IOException {
        brClientInput = 
            new BufferedReader(new InputStreamReader(sSocket.getInputStream()));
    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Methods">
    /**
     * Get the next response from the client
     * BufferedReader.readLine()
     * 
     * @return  The clients response.
     * @throws IOException 
     */
    public String getClientResponse() throws IOException{
        return brClientInput.readLine();
    }
    // </editor-fold>
}
